<template>
  <div class="wrapper">
    <div class="box">
      <div id="pdfDom">
        <!-- 要下载的HTML页面,页面是由后台返回 -->
         <h1>好好學習</h1>
         <h2>給我一首歌的時間</h2>

         <div class="flag"></div>
      </div>
    </div>
    <div class="action">
      <div class="btn" @click="test">测试</div>
    </div>
  </div>
</template>

<script>
import dayjs from 'dayjs'
console.log('当前系统时间：', dayjs().format('YYYY-MM-DD HH:mm:ss'))
export default {
  components: {},
  props: {},
  data() {
    return {}
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  activated() {},
  deactivated() {},
  updated() {},
  beforeDestroy() {},
  destroyed() {},
  methods: {
    test() {
      this.getPdf('測試')
    }
  },
  filters: {}
}
</script>
<style scoped lang="scss">
@mixin oneline {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.wrapper {
  height: 100%;
  position: relative;
  border: 1px solid #000;
  .box {
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 6px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 600px;
    overflow: auto;
    #pdfDom {
      height: 2000px;
      border: 1px solid red;
      position: relative;

      .flag {
        position: absolute;
        bottom: 0;
        right: 0;
        width: 100px;
        height: 100px;
        background-color: #1acd7e;
      }
    }
  }
}
</style>
